<?php

namespace App\Repositories;

use App\Exceptions\BasicException;
use Illuminate\Support\Facades\Hash;
use function Matrix\add;    //引入hash

class GameJackpotPersonRepository {

    /*
     *获取一条数据信息
     * @param $where
     * @return bool
     * @throws BasicException
     * */
    public function getOneInfo($where) {
        $getOneInfo = app('model_game_jackpot_person')->where($where)->first();
        return $getOneInfo;
    }

    /*
     *某字段增加数值
     * @param $where
     * @param $field
     * @param $number
     * @return bool
     * @throws BasicException
     * */
    public function  addNumber($where,$number,$field){
        $addNumber = app('model_game_jackpot_person')->where($where)->increment($field,$number);
        if ($addNumber) return $addNumber;
        throw new BasicException(93083);
    }

    /*
     *新增数据
     * @param $param
     * @return bool
     * @throws BasicException
     * */
    public function  add($param){
        $add = app('model_game_jackpot_person')->create($param);
        if ($add) return $add;
        throw new BasicException(93084);
    }

}
?>